package com.star.banner.controller;

import com.star.banner.entity.Banner;
import com.star.banner.service.BannerService;
import com.star.core.base.BaseController;
import com.star.security.annotations.Authorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * web端获取banner
 *
 * @author lty
 */
@RestController
@RequestMapping("/web/bannerWeb")
public class BannerWebController extends BaseController {

    @Resource
    private BannerService bannerService;

    /**
     * 通过位置查询横幅信息
     * @param positions
     * @return
     */
    @GetMapping("/listBanner")
    public List<Banner> listBanner(@PathVariable String positions){
        return bannerService.listBanner(positions);
    }
}
